package com.gz.order.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import java.util.HashMap;

@RestController
@RequestMapping("/order/api")
public class OrderController {
    private String url = "http://CLOUD-PAYMENT-SERVICE";

    @Autowired
    private RestTemplate restTemplate;

    @GetMapping("/getMsg")
    public HashMap<String, String> getMessage() {
        return restTemplate.postForObject(url+"/pay/api/test", null, HashMap.class);
    }


}
